{include file="public/header" /} 
		<div class="nav_bar in_width">
			<a href="{:url('index/index')}">首页</a>
			<span>&gt;&gt;</span>
					{$info.category_id|get_place}
			
				<span>&gt;&gt;</span>
			<span>{$info.title}</span>
		</div>
		<div class="content">
			<div class="content_in in_width">
				<div class="fl main_left">
					<div class="article_content">
						<div class="ac_in_width article_title">{$info.title}</div>
						<div class="ac_in_width article_desc">
							<span class="article_time">{$info.create_time|date="Y-m-d h:i",###}</span>
							<span class="article_source">作者：{$info.uid|get_username}</span>
							<a class="article_activity" href="javascript:void(0)">我有话要说（{$info.comment}人参与）</a>
						</div>	
						
						<div class="article_p">
							
	{if condition="$info['auth'] eq 0"}
							   <div class="pay"> <a class="btn_pay" href="{:url('pay/add?id='.$info['id'])}">支付¥ {$info.price}</a></div>
                              {else/}
							{$info.content}
							 
							  {/if}
							</div>
					</div>
					<div class="ac_in_width article_comment">
						<div class="article_comment_title">新闻评论</div>
						<div class="article_comment_div ac_in_width">
							<div class="article_comment_user fl">
								<img src="__IMG__/user_icon.png"/>
								<span class="article_comment_user_name">匿名</span>
							</div>
							<div class="article_comment_box fl">
								<i class="input_arrow"></i>
								<textarea class="article_comment_input" placeholder="您的观点仅代表您本人，请文明发言，严禁散播谣言和诽谤他人"></textarea>
								<div class="article_comment_tips">
								{if condition="is_login() eq 0"}
								<a href="{:url('user/login')}">登录</a>
								<a href="{:url('user/register')};">注册</a>
								{/if}
								</div>
								<div class="article_comment_btn">
									<span class="article_comment_tip_span">Ctrl+Enter快捷提交</span>
									<span class="article_comment_submit" onclick="submit()">马上发表</span>
								</div>
							</div>
						</div>
					</div>
					<div class="ac_in_width article_comment_list">
						<div class="article_comment_title">最新评论<span class="act_span1">(评论<span class="comment_nums">{$res["count"]}</span>条  <a href="javascript:void(0);">查看全部&gt;&gt;</a>)</span></div>
					{volist name="res.list" id="vo"}  
				  <div class="article_comment_item ac_in_width">
					    	<div class="fl comment_item_user_warpper">
					    		<img src="__IMG__/user_icon.png"/>
					    	</div>
					    	<div class="comment_item_content_div">
					    		<div class="cicd_title">
					    			<span class="cicd_username fl">{$vo.uid|get_username}</span>
					    			<span class="cicd_place fl"></span>
					    			<span class="cicd_time fr">{$vo.create_time|date="Y-m-d h:i",###}发表</span>
					    		</div>
					    		<div class="cicd_content">
								 {if condition="$vo['pid'] gt 0"}
								 @{$vo.pid|get_comment="content"}  
								{/if}<p>&nbsp;&nbsp;&nbsp;&nbsp;{$vo.content}</p>
					    		</div>
					    		<div class="cicd_opr">
					    			<div class="fr">
						    			<a onclick="ding({$vo.id})" class="cicd_opr_ding">顶<span>({$vo.zan})</span></a>
						    			<a onclick="reply(this,{$vo.id})" class="reply_btn">回复</a>
						    			
					    			</div>
					    		</div>
					    	</div>
					    	<div class="clear"></div>
					    </div>
						{/volist}
						{$res.page}
					
					    <div class="ac_in_width reply_div none">
					    	<div class="article_reply_user fl">
								<img src="__IMG__/user_icon.png"/>
								<span class="article_reply_user_name">匿名</span>
							</div>
							<div class="article_reply_box fl">
								<i class="input_arrow"></i>
								<input name="c_id" type="hidden">
								<textarea class="article_reply_input" placeholder="您的观点仅代表您本人，请文明发言，严禁散播谣言和诽谤他人"></textarea>
								<div class="article_comment_tips">
								{if condition="is_login() eq 0"}
								<a href="{:url('user/login')}">登录</a>
								<a href="{:url('user/register')};">注册</a>
								{/if}
								
								</div>
								<div class="article_comment_btn">
									<span class="article_comment_tip_span">Ctrl+Enter快捷提交</span>
									<span class="article_comment_submit" onclick="comment(this)">马上发表</span>
								</div>
							</div>
					    </div>
					</div>
					<div class="clear"></div>
				</div>
				<div class="fl content_right">
				<div class="rank_div">
						<div class="rank_title">付费排行
							
						</div>
						<ul class="rank_list">
						  {volist name="paylist" id="vo"}
			              <li><a href="{:url('article/detail?id='.$vo['id'])}">{$vo.title|substr_cn="49"}    </a>
				         </li>
		                  {/volist}
						</ul>
					</div>
					<div class="rank_div">
						<div class="rank_title black_color">点击排行
						
						</div>
						<ul class="rank_list">
					{By:read  model_id="1" name="vo" order="view desc" limit="10"}
			       <li><a href="{:url('article/detail?id='.$vo['id'])}"><span>{$i}.</span>{$vo.title|substr_cn="29"}    </a>
				   </li>
				 
		           {/By:read}
						</ul>
					</div>
					<div class="ad_img1">
					  {By:ad place='2' name="vo"}
             		 <a href="{$vo.url|get_url}" class="1"> 
					 <img src="{$vo.cover_id|get_cover_path}"></a>
		             {/By:ad}
					</div>
					<div class="latest_posts">
					<div class="latest_posts_title">最新发布</div>
						<ul class="latest_posts_list">
						{By:read  model_id="1" name="vo" order="id desc" limit="10"}
			      <li><a href="{:url('article/detail?id='.$vo['id'])}"><span>{$i}.</span>{$vo.title|substr_cn="29"}    </a>
				   </li>
		         {/By:read}	
						</ul>
					</div>
					<div class="clear"></div>
				</div>
				<div class="clear"></div>
			</div>
		</div>
		{include file="public/footer" /}
		
		<div class="mask none">
			<div class="alert_success alert_div">
				<div class="alert_header">提示</div>
				<div class="alert_content"><i></i><span class="success">评论成功<span></div>
				<div class="alert_btn">确定</div>
				<span class="alert_close"></span>
			</div>
		</div>
		<div class="mask none">
			<div class="alert_error alert_div">
				<div class="alert_header">提示</div>
				<div class="alert_content"><i></i><span class="error">评论失败<span></div>
				<div class="alert_btn">确定</div>
				<span class="alert_close"></span>
			</div>
		</div>
		<script>
		   function comment(obj){
			     
				var c_id=$(obj).parents(".reply_div").find("input").val();
				var content=$(obj).parents(".reply_div").find("textarea").val();
				  var id="{$info.id}";
			      var url="{:url('Comment/reply')}"
		         $.post(url,{doc_id:id,content:content,pid:c_id},function(data){
                  if(data.code){
			        opensuccess(data);
		          }else{
		            openerror(data);
		         }
              });
			}
			 function reply(obj,c_id){
			     if($(obj).parents(".article_comment_item").first().find(".reply_div").length != 0){
						$(obj).parents(".article_comment_item").first().find(".reply_div").removeClass("none");
						return false;
					}
					$("input[name='c_id']").val(c_id);
					var clone = $(".article_comment_list .article_comment_title").siblings(".reply_div").clone();
					clone.removeClass("none");
					$(obj).parents(".comment_item_content_div").first().after(clone);
			}
			$(".mask .alert_div .alert_close").click(function(){
			    $(this).parents(".mask").addClass("none");
			});
			$(".mask .alert_div .alert_btn").click(function(){
			    $(this).parents(".mask").addClass("none");
			});
			$(".article_comment_submit").click(function(){
				openerror();
			})
			function opensuccess(data){
				$(".success").text(data.msg);
				$(".alert_success").parents(".mask").removeClass("none");
				 setTimeout(function(){
                        if (data.url) {
                            location.href=data.url;
                        }
             },1500);
			}
			function openerror(data){
			    $(".error").text(data.msg);
				$(".alert_error").parents(".mask").removeClass("none");
			}
			function submit(){
			   var content=$(".article_comment_input").val();
			   var id="{$info.id}";
			   var url="{:url('Comment/add')}"
		       $.post(url,{doc_id:id,content:content},function(data){
                  if(data.code){
			        opensuccess(data);
		          }else{
		            openerror(data);
		         }
              });
		}
		function ding(id){
			  
			   var url="{:url('Comment/update')}"
		       $.post(url,{id:id},function(data){
                if(data.code){
			        opensuccess(data);
		       }else{
		            openerror(data);
		       }
              });
		}

		</script>
	</body>
</html>
